//从welcome跳转到其他页面后需要管理页面标题高亮
import { defineStore } from "pinia";
import { ref } from "vue";

export const useEventsStore = defineStore("events", () => {
  const index = ref();
  const Events = ref({});
  const setIndex = (id) => {
    index.value = id;
  }; 

  const showEvents = ()=>{
    console.log(index.value);
    
    if(index.value == 0){
      Events.value = {
        title:"移动应用软件开发"
      }
    }else if(index.value == 1){
      Events.value = {
        title:"创新创业大赛"
      }
    }else{
      Events.value = {
        title:"错误"
      }
    }
    // console.log( Events.value);
  }
  return {
    setIndex,
    showEvents,
    index,
    Events
  };
});
